package routers

import (
	"github.com/gin-gonic/gin"
	"shop-admin/controller"
	"shop-security/preAuthorize"
)

func privateCategory(router *gin.RouterGroup) {
	api := &controller.CategoryController{}
	category := router.Group("/prod/category")
	{
		category.GET("/list", preAuthorize.HasPermission("prod:category:list"), api.List)               //获取全部分类
		category.GET("/info/:categoryId", preAuthorize.HasPermission("prod:category:info"), api.Info)   //获取分类信息
		category.POST("", preAuthorize.HasPermission("prod:category:save"), api.Save)                   //保存分类
		category.PUT("", preAuthorize.HasPermission("prod:category:update"), api.Update)                //更新分类
		category.DELETE("/:categoryId", preAuthorize.HasPermission("prod:category:delete"), api.Delete) //删除分类
	}
}
